<%@ page import="ar.com.photo_admin.domain.Photographer" %>
<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
	<meta name="layout" content="main">
</head>
<body>
	<div class="page-header">
		<h1>
			<g:message code="photographer.configuration" />
		</h1>
	</div>
	
	<g:if test="${flash.message}">
		<div class="alert alert-success">  
		  <a class="close" data-dismiss="alert">×</a>  
		  <div class="message">${flash.message}</div>  
		</div>  
	</g:if>
	
	<g:hasErrors bean="${photographerInstance}">
		<g:eachError bean="${photographerInstance}" var="error">
			<div class="alert alert-error">
				<a class="close" data-dismiss="alert">×</a>
				<g:message error="${error}" />
			</div>
		</g:eachError>
	</g:hasErrors>
			
	<g:form id="configForm" class="form-horizontal" controller="photographerConfiguration" action="save">
			
		<h2><g:message code="photographer.prices" /></h2>			
			
		<g:each in="${photographerInstance?.pricesConfiguration?.prices}" status="i" var="aPrice">
			<div class="control-group">
				<label class="control-label" for="${aPrice.size}">${aPrice.size} <span class="required-indicator">*</span></label>
				<div class="controls">							
					<g:field type="number"  min="0"  maxlength="6" required="" name="pricesConfiguration.prices[${i}].price" placeholder="Precio" value="${fieldValue(bean: aPrice, field: 'price')}" />
				</div>
			</div>																					
		</g:each>

		<div class="separatorUsingBorder"></div>				 						
		<h2><g:message code="photographer.price.min" /></h2>	 						
						
		<div class="control-group">
			<label class="control-label" for="minPrice">
				<g:message code="configuration.price.label" default="Precio" />
				<span class="required-indicator">*</span>
			</label>
			<div class="controls">
				<g:field type="number" id="minOrderCost" maxlength="6" name="minOrderCost" min="0" required="" value="${fieldValue(bean: photographerInstance, field: 'minOrderCost')}"/>
			</div>
		</div>
		
		<div class="separatorUsingBorder"></div>				 						
		<h2><g:message code="onlinePayment" /></h2>
		
		<div class="control-group">		
			<div class="controls">		
				<g:checkBox name="paymentOnlineEnabled"  value="${photographerInstance?.paymentOnlineEnabled}"/>				
				<g:message code="photographer.onlinePayment.enabled"  />										
			</div>	
		</div>
		
		<div id="btn-group" class="btn-group">
			<button type="submit" class="btn btn-success"><g:message code="save" /></button>
			<g:link class="btn btn-success" controller="photographerConfiguration"
				action="index">
				<g:message code="cancel" />
			</g:link>
		</div>
		
		<div class="separator"></div>	
	</g:form>
</body>
</html>